﻿using FS.Common.DotNetBean;
using FS.Common.DotNetCode;
using FS.Common.DotNetUI;
using FS.Business;
using System;
using System.Collections;
using System.Data;
using System.Text;
using System.Collections.Generic;

namespace FS.Web.BLL.Visa_info
{
    public partial class Visa_InfoShipToBathForm : PageBase
    {
        private string _key;
        private visa_dao _visa = new visa_dao();
        protected void Page_Load(object sender, EventArgs e)
        {
            this._key = base.Request["key"];
            if (!base.IsPostBack)
            {
                GetSelect_City();                
                GetSelect_CertType();
                GetSelect_Supply();
            }
        }
        #region 下拉框数据
        //所属国家
        private void GetSelect_City()
        {
            DataTable dt = _visa.GetSelect_CityInfo();
            ControlBindHelper.BindHtmlSelect(dt, this.City_id, "city_name", "city_id", "请选择");
        }

        //签证类型
        private void GetSelect_CertType()
        {
            DataTable dt = _visa.GetSelect_CertType();
            ControlBindHelper.BindHtmlSelect(dt, this.Ref_CertType, "property_value", "property_key", "请选择");
        }

        //供应商
        private void GetSelect_Supply()
        {

            DataTable dt = _visa.GetSelect_SupplyInfoSimple();
            ControlBindHelper.BindHtmlSelect(dt, this.Supply_id, "supply_name", "supply_id", "请选择");
        }
        #endregion

        protected void Save_Click(object sender, EventArgs e)
        {
            string ls_city = this.City_id.Value;
            string ls_certtype = this.Ref_CertType.Value;
            string ls_supply = this.Supply_id.Value;
            string ls_cusname = this.cusname.Value;
            string ls_rmk = this.InfoDetail_remark.Value.Trim();

            bool IsOk = _visa.InfoShip_BatchChange(this._key.Split(','),ls_city,ls_certtype,ls_supply,
                ls_cusname,ls_rmk,_userid,_username);
            if (IsOk)
            {
                ShowMsgHelper.AlertMsg("操作成功！");
            }
            else
            {
                ShowMsgHelper.Alert_Error("操作失败！");
            }
        }
    }
}